//你的程序将被嵌在这里
#include <iostream>
#include <cstring>
using namespace std;
class Memmal
{
private:
    float age,weight;
    string color;
public:
    Memmal(){
        cout<<"Constructor in Mammal."<<endl;
    }
    void setAge(float i)
    {
        age=i;
    }
    void setWeight(float i)
    {
        weight=i;
    }
    void setColor(string i)
    {
        color=i;
    }
    ~Memmal(){
        cout<<"Destructor in Mammal."<<endl;
    }
    float getAge()
    {
        return age;
    }
    float getWeight()
    {
        return weight;
    }
    string getColor()
    {
        return color;
    }
};

class Dog:public Memmal
{
private:
    string roar;
public:
    Dog():Memmal(),roar("wang,wang,wang!"){
        cout<<"Constructor in Dog."<<endl;
    }
    void speak()
    {
        cout<<"Dog sound "<<roar<<endl;
    }
    ~Dog(){
        cout<<"Destructor in Dog."<<endl;
    }

};


int main()
{
    Dog d;
    d.setAge(4);
    d.setWeight(12);
    d.setColor("Black");
    cout<<d.getAge()<<endl;
    cout<<d.getWeight()<<endl;
    cout<<d.getColor()<<endl;
    d.speak();

    return 0;

}